#!/usr/bin/env python3.9
# -*- encoding: utf-8 -*-
"""
@文件        :views.py
@说明        :
@时间        :2022/12/06 08:43:08
@作者        :Mars
@版本        :1.0
"""


from django.shortcuts import render
from rest_framework import filters
from rest_framework.viewsets import ReadOnlyModelViewSet

from .models import Advertisement
from .serializers import AdvertisementSerializer

# Create your views here.
#!/usr/bin/env python3.9


class AdvertisementView(ReadOnlyModelViewSet):
    queryset = Advertisement.objects.all()
    serializer_class = AdvertisementSerializer
    filterset_fields = ["position"]
